﻿<%@ WebHandler Language="C#" Class="wxMiniProgramLogin" %>
using Models;
using System;
using System.Web;
using Newtonsoft.Json;
using System.Linq;
using System.Collections.Generic;
using System.IO;
using System.Net;
using Newtonsoft.Json.Linq;


public class wxMiniProgramLogin : IHttpHandler {
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";

        string postdata=Utils.PostInput(context);
        JObject jo = (JObject)JsonConvert.DeserializeObject(postdata);
        string js_code = jo["goods_list"].ToString();
        string authHeader = context.Request.Headers["token"];//Header中的token
        if (string.IsNullOrEmpty(authHeader))
        {
            HttpContext.Current.Response.Write("parameter error");
            return;
        }


           var code = 1;
        var msg = "商品详情";
        var time = DateTime.Now;
          using (Entities bll = new Entities())
        {
         


            var data = new
            {
          goods_original_amount="260.00",
          goods_amount="128.00",
         dispatch_amount="0.00",
          total_amount="128.00",
          total_fee="128.00",
           discount_fee="0.00",
          coupon_fee="0.00",
           activity_type="",
           score_amount=0,
           new_goods_list=js_code,
          need_address=1
            };

            context.Response.Write(JsonConvert.SerializeObject(new { code,msg,time,data}));

        }

        HttpContext.Current.Response.End();

    }



    public bool IsReusable {
        get {
            return false;
        }
    }

}